package demo.practice.leetcode;

public class P998 {
    //https://leetcode-cn.com/problems/maximum-binary-tree-ii/

    public TreeNode insertIntoMaxTree(TreeNode root, int val) {
        TreeNode newNode = new TreeNode(val);
        if(root==null)
            return newNode;
        if(root.val<val){
            newNode.left=root;
            return newNode;
        }
        root.right= insertIntoMaxTree(root.right,val);
        return root;
    }



}
